import 'package:flutter/material.dart';
import 'package:flutter_shop/pages/home/tab_Index/index_navigator_item.dart';

class IndexNavigator extends StatefulWidget {
  @override
  State<IndexNavigator> createState() => _IndexNavigatorState();
}

class _IndexNavigatorState extends State<IndexNavigator> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: navigatorItemList
            .map((item) => InkWell(
                  onTap: () {
                    item.onTap(context);
                  },
                  child: Column(
                    children: [
                      SizedBox(
                        height: 10,
                      ),
                      Image.asset(
                        item.image,
                        width: 30,
                      ),
                      Container(
                        margin: EdgeInsets.only(top: 5),
                        child: Text(
                          item.title,
                          style: TextStyle(fontWeight: FontWeight.bold),
                        ),
                      ),
                    ],
                  ),
                ))
            .toList(),
      ),
    );
  }
}
